package com.czx.listener;

import com.czx.even.UserEven;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class SmsListener implements ApplicationListener<UserEven> {
    @Override
    @Async
    public void onApplicationEvent(UserEven userEven) {
        System.out.println(Thread.currentThread().getName() + "发送短信到" + userEven.getMobile());
    }
}
